package com.yyh1;

public class Cylinder extends Circle{
    //属性
    //圆柱体的高
    private double hight;
    //无参
    public Cylinder(double radius) {
        super(radius);
    }
    //有参
    public Cylinder(double radius, double hight) {
        super(radius);
        this.hight = hight;
    }
    //getter 和setter
    public double getHight() {
        return hight;
    }

    public void setHight(double hight) {
        this.hight = hight;
    }
    //行为
    //圆柱体的体积
    public double getVolume(){
        return super.getArea()*hight;
    }
    //输出
    public void showVolume(){
        System.out.println("圆柱体的高为："+hight+",圆柱体的体积为："+getVolume());
    }
}
